//
//  HexMapLayer.h
//  DiceWar
//
//  Created by xiaofeng on 25/6/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#ifndef CLASSES_GAME_GAMEPLAY_HEXMAPLAYER_H_
#define CLASSES_GAME_GAMEPLAY_HEXMAPLAYER_H_

#include "cocos2d.h"
#include "StaticMatrix.h"
#include "HexMapGridLayer.h"

class HexMapLayer: public cocos2d::CCLayer
{
public:
    LAYER_NODE_FUNC(HexMapLayer);
    
    bool init();
    
    void updateMapView();
    void updateMapViewForGrid(int coordinateX, int coordinateY);
    
private:
    HexMapGridLayer* getGridView(int coordinateX, int coordinateY);
    void setGridView(int coordinateX, int coordinateY, HexMapGridLayer* pGridView);
    
    void createHexMapGridLayers();
    
private:
    typedef StaticMatrix<HexMapGridLayer*, gameConstants::kHexMapSizeX, gameConstants::kHexMapSizeY> HexMapGridLayerMatrix;
    typedef HexMapGridLayerMatrix::iterator MatrixIter;
    
    HexMapGridLayerMatrix m_mapView;
    cocos2d::CCSprite* m_pCurrentPlayerSprite;
};

#endif //CLASSES_GAME_GAMEPLAY_HEXMAPLAYER_H_
